<template>
    <div class="un-login-tip-mask" v-if="showmask">
        <div class="unlogin-tip-con">
            <a @click="handleUnlogin(0)">注册</a>或<a @click="handleUnlogin(1)">登录</a>后可查看更多优质内容哦~
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            showmask: false
        }
    },
    methods: {
        handleUnlogin(_type) {
            if (location.href.indexOf('/imgv') > -1 && this.$route.name != 'imgv') {
                let parent = this.$parent.$parent.$parent.$parent.$parent.$parent.$parent;
                parent.noLoginIsTak = false;
                parent.showLoginView = true;
                this.showLoginNum = 1;
            } else if (this.$route.name == 'imgv') {
                let parent = this.$parent.$parent.$parent;
                parent.noLoginIsTak = false;
                parent.showLoginView = true;
                this.showLoginNum = 1;
            }
            else {
                this.$parent.$parent.loginType = _type;
                this.$parent.$parent.showLoginView = true;
            }
        }
    },
    mounted() {
        if (!localStorage.getItem('token')) {
            this.showmask = true;
        }
    }
}
</script>

<style lang="less">
.un-login-tip-mask {
    margin-bottom: 123px;
    text-align: center;
    padding-top: 56px;
    position: relative;

    .unlogin-tip-con {
        position: relative;
        z-index: 1;
        color: #969696;
        line-height: 20px;

        a {
            color: #fff;
            margin: 0px 5px;

            &:hover {
                color: #11CCB1;
                text-decoration: underline;
            }
        }
    }

    &:before {
        content: '';
        height:300px;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #1D1C1B 100%);
        position: absolute;
        left: 0px;
        right: 0px;
        bottom: 0px;
        z-index: 1;
    }
}
</style>